# 交叉编译工具配置 (如果需要)

# 工程类型["MinGW Makefiles" | "Unix Makefiles" | "MSYS Makefiles"]
# set(CMAKE_C_COMPILER "D:/Program Files/msys64/mingw64/bin/gcc.exe")
# set(CMAKE_CXX_COMPILER "D:/Program Files/msys64/mingw64/bin/g++.exe")
# set(CMAKE_LINKER "D:/Program Files/msys64/mingw64/bin/ld.exe")
# set(CMAKE_SYSROOT "D:/Program Files/msys64/mingw64")
# set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}/include)
# set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
# set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
# set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)



set(CMAKE_SYSTEM_NAME Linux)
set(SYSROOT_PATH ${AG35_EUTDA_SDK_PATH}/ql-sysroots) # 指向一个包含了目标系统头文件和库文件的目录
set(TOOLCHAIN_PATH /opt/ql_crosstools/ql-ag35-1806e-gcc-8.4.0-glibc-v1-toolchain/bin)
set(CC_TOOL_PREFIX arm-openwrt-linux)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PATH}/${CC_TOOL_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PATH}/${CC_TOOL_PREFIX}-g++) 

set (CMAKE_C_FLAGS "-march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=${SYSROOT_PATH}")
set (CMAKE_CXX_FLAGS "-march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=${SYSROOT_PATH}")

set (CMAKE_C_FLAGS_DEBUG "-ggdb -ffunction-sections -O0")
set (CMAKE_CXX_FLAGS_DEBUG "-ggdb -ffunction-sections -O0")
set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "-Wl,-gc-sections")
set (CMAKE_C_FLAGS_RELEASE "-ffunction-sections -O3")
set (CMAKE_CXX_FLAGS_RELEASE "-ffunction-sections -O3")
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-gc-sections")

set(CMAKE_C_STANDARD 99)

set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
